<?php

    class File_Types extends ActiveRecord {
        
        function File_Types()
        {
            $conf = array('table'=>DB_PREFIX.'file_types');
            $this->ActiveRecord($conf);
        }
        
        function validate()
        {
            $this->validates_format_of('ext','!\w{3,4}!','Extention must be like jpg or pdf. No period before extention');
        }
        
        function get_allowed_types()
        {
            return $this->find( array('search'=>'all'));
        }
        
        function get_file_extentions()
        {
            return $this->find( array('fields'=>'ext') );
        }
    }

?>